package com.rmt.www.action;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.rmt.www.dao.ProjectDao;
import com.rmt.www.dao.RequestDao;
import com.rmt.www.dao.UserDao;
import com.rmt.www.daoImpl.RequestDaoImpl;
import com.rmt.www.service.AdminManageChangeService;
import com.rmt.www.vo.Artifact;
import com.rmt.www.vo.DesignArtifactRequest;
import com.rmt.www.vo.FeatureArtifactRequest;
import com.rmt.www.vo.ImplementationArtifactRequest;
import com.rmt.www.vo.Project;
import com.rmt.www.vo.Request;
import com.rmt.www.vo.RequirementArtifactRequest;
import com.rmt.www.vo.TestArtifactRequest;
import com.rmt.www.vo.User;


public class ChangeControlAction extends ActionSupport{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int pid;
	private String pname;
	private List<FeatureArtifactRequest> featureArtifactRequestList;
	private List<RequirementArtifactRequest> requirementArtifactRequestList;
	private List<DesignArtifactRequest> designArtifactRequestList;
	private List<ImplementationArtifactRequest> implementationArtifactRequestList;
	private List<TestArtifactRequest> testArtifactRequestList;
	private AdminManageChangeService adminManageChangeService;
	
	public int getPid() {
		return pid;
	}

	public void setPid(int pid) {
		this.pid = pid;
	}
	
	public String execute(){
		featureArtifactRequestList = adminManageChangeService.getProjectFeatureRequests(pid);
		requirementArtifactRequestList = adminManageChangeService.getProjectRequirementRequest(pid);
		designArtifactRequestList = adminManageChangeService.getProjectDesignRequests(pid);
		implementationArtifactRequestList = adminManageChangeService.getProjectImplementation(pid);
		testArtifactRequestList = adminManageChangeService.getProjectTestCase(pid);
		pname = adminManageChangeService.getProjectName(pid);
		return "success";
	}

	public String getPname() {
		return pname;
	}

	public void setPname(String pname) {
		this.pname = pname;
	}

	public List<FeatureArtifactRequest> getFeatureArtifactRequestList() {
		return featureArtifactRequestList;
	}

	public void setFeatureArtifactRequestList(
			List<FeatureArtifactRequest> featureArtifactRequestList) {
		this.featureArtifactRequestList = featureArtifactRequestList;
	}

	public List<RequirementArtifactRequest> getRequirementArtifactRequestList() {
		return requirementArtifactRequestList;
	}

	public void setRequirementArtifactRequestList(
			List<RequirementArtifactRequest> requirementArtifactRequestList) {
		this.requirementArtifactRequestList = requirementArtifactRequestList;
	}

	public List<DesignArtifactRequest> getDesignArtifactRequestList() {
		return designArtifactRequestList;
	}

	public void setDesignArtifactRequestList(
			List<DesignArtifactRequest> designArtifactRequestList) {
		this.designArtifactRequestList = designArtifactRequestList;
	}

	public List<ImplementationArtifactRequest> getImplementationArtifactRequestList() {
		return implementationArtifactRequestList;
	}

	public void setImplementationArtifactRequestList(
			List<ImplementationArtifactRequest> implementationArtifactRequestList) {
		this.implementationArtifactRequestList = implementationArtifactRequestList;
	}

	public List<TestArtifactRequest> getTestArtifactRequestList() {
		return testArtifactRequestList;
	}

	public void setTestArtifactRequestList(
			List<TestArtifactRequest> testArtifactRequestList) {
		this.testArtifactRequestList = testArtifactRequestList;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public AdminManageChangeService getAdminManageChangeService() {
		return adminManageChangeService;
	}

	public void setAdminManageChangeService(
			AdminManageChangeService adminManageChangeService) {
		this.adminManageChangeService = adminManageChangeService;
	}
}
